[% setvar title The Perl 6 Summary for the week ending 2004-04-04 %]
<div id="archive-notice">
    <h3>This file is part of the Perl 6 Archive</h3>
    <p>To see what is currently happening visit <a href="http://www.perl6.org/">http://www.perl6.org/</a></p>
</div>
<div class='pod'>
<a name='The Perl 6 Summary for the week ending 2004-04-04'></a><h1>The Perl 6 Summary for the week ending 2004-04-04</h1>
<p>Wednesday? Why did I leave it 'til Wednesday to write the summary? I
must have <i>some</i> reason. Or maybe not. I'll give fair warning that I
won't be doing a summary for next week though, what with Easter and
everything, but you'll get a fortnight's summary the week after,
because I'm good to you like that.</p>
<p>We'll start this week's summary with perl6-internals.</p>
<a name='MMD vtable functions in bytecode'></a><h2>MMD vtable functions in bytecode</h2>
<p>Dan had announced that he was working on adding parrot bytecode support
for multimethod dispatch, and outlined how they'd be used and got
semi-Warnocked.</p>
<p>The discussion got going this week, Leo Tötsch was unsure about some of Dan's
implementation choices. In particular, he wondered if MMD subs should
use PMCs rather than the simple function pointer that Dan had used. Dan
thought not.</p>
<p><a href='http://groups.google.com/groups?selm=a06010203bc88de42bcc6@' target='_blank'>groups.google.com</a>[172.24.18.98]</p>
<a name='Behaviour of PMCs on assignment'></a><h2>Behaviour of PMCs on assignment</h2>
<p>The discussion of what to do when assigning to PMCs continued. The
issue is complicated because we are trying to be friendly to multiple
languages (though, as far as I can tell, the really problematic issue
is Perl Scalars; most of the other languages that spring to mind
have variables that are 'simple' pointers to objects; Perl Scalars can
hold (seemingly) a million and one different things, potentially all at
once). TOGoS argued that, as things stand there's a disjunction between
the way (say) integer registers work and the way PMC registers
work. With Integer registers, if you do</p>
<pre>    $I1 = $I2 + $I3</pre>
<p>then <code>$I1</code> gets a 'new' integer; there doesn't need to be a preexisting
integer. However, if you were to do:</p>
<pre>    $P1 = $P2 + $P3</pre>
<p>what actually happens (assuming we're using straightforward PMCs
here...) is more like:</p>
<pre>    $P1.value = $P2 + $P3</pre>
<p>In other words, you need a preexisting <code>$P1</code>. Leo agreed with TOGoS's
argument, but worried that implementing it would blow core size up to
an insane value. Dan didn't agree with TOGoS though, but I'm afraid I
didn't quite follow his reasoning (probably because I'm being dumb this
morning).</p>
<p><a href='http://groups.google.com/groups?selm=a06010205bc8de88d9b5e@' target='_blank'>groups.google.com</a>[10.0.1.2]</p>
<a name='In which your Summarizer asks dumb questions'></a><h2>In which your Summarizer asks dumb questions</h2>
<p>In an extended moment of stupidity, Piers Cawley asked why we had
distinct register and user stacks. Leo explained it to him, very
politely I thought.</p>
<p><a href='http://groups.google.com/groups?selm=m2isgnzxtc.fsf@obelisk.bofh.org.uk' target='_blank'>groups.google.com</a></p>
<a name='Stalking the wily Garbage Collector bug'></a><h2>Stalking the wily Garbage Collector bug</h2>
<p>Jens Rieks's <i>projet du jour</i> -- an EBNF parser in Parrot -- tweaked a
garbage collection bug so he posted appropriate debug traces and Leo set
to work on it. He didn't get it working fully, but it takes longer to
crash now (but it crashes in the same bit of C code). Jens thinks it's
a problem with Parrot's handling of strings.</p>
<p><a href='http://groups.google.com/groups?selm=200403291218.47861.parrot@jensbeimsurfen.de' target='_blank'>groups.google.com</a></p>
<a name='New SDL Parrot bindings underway'></a><h2>New SDL Parrot bindings underway</h2>
<p>That stalwart of Portland.pm, chromatic, announced that he's in the
process of porting the existing SDL Parrot bindings to use our shiny
new Object system. Jens Rieks wondered why he was prefixing his method
names with underscores (you only need underscores for globally visible
functions, methods can have straightforward names). Tim Bunce wondered
why chromatic wasn't using nested namespaces. Leo pointed out that
nested namespaces haven't been implemented just yet.</p>
<p><a href='http://groups.google.com/groups?selm=1080632006.13206.69.camel@localhost' target='_blank'>groups.google.com</a></p>
<a name='Some new classes'></a><h2>Some new classes</h2>
<p>Dan checked in some stub code for PMCArray and StringArray. Eventually
they'll be auto-resizable, PMC or String only arrays, but right now
they're simple wrappers for PerlArray. He suggested that rewriting them
so they were real, efficient arrays would be a Good Thing (and, I
suggest, a relatively gentle introduction to Parrot hacking if anyone
reading this is interested.)</p>
<p>Jens Rieks offered up a patch for his data dumper so it could take them
into account, which Dan applied.</p>
<p><a href='http://groups.google.com/groups?selm=a06010216bc8f56b09896@' target='_blank'>groups.google.com</a>[10.0.1.2]</p>
<a name='Points of focus'></a><h2>Points of focus</h2>
<p>Dan went all Managerial on our collective donkey and posted a nice
bulletted list of things that need sorting out for a 0.1.1 release. The
general thrust of the message is bug fixing and documenting, which is
good.</p>
<p><a href='http://groups.google.com/groups?selm=a06010228bc90bf17fd33@' target='_blank'>groups.google.com</a>[10.0.1.2]</p>
<a name='Fun with non deterministic searches'></a><h2>Fun with non deterministic searches</h2>
<p>One of the canonical illustrations of things to do with continuations
is non deterministic searches. Imagine that you could write</p>
<pre>    $x = choose(1,3,5,9)
    $y = choose(1,5,9,13)

    assert $x * $y == 15
    
    print &quot;$x * $y == &quot;, $x * $y, &quot;\n&quot;</pre>
<p>and have &quot;3 * 5 == 15&quot; printed out. (Okay, so in Perl 6 you're going to
be able to do that with junctions, but this is about an underlying
implementation). Piers Cawley translated a simple non deterministic
search algorithm from scheme to Parrot and posted the (initially
failing) code to the list and pointed out that, even if he tweaked IMCC
to generate full continuations instead of RetContinuations and turned
of garbage collection, Parrot fell over with a bus error.</p>
<p>Once he'd explained how it worked (in a post made on April Fools' Day
no less) and Leo had wrapped his head round it, the work went on to
make it work. It turns out that Parrot had a few too many assumptions
about how call stacks would work (starting with the assumption that you
could simply reused a stack frame once you'd returned through it; in
the presence of a full continuation you have to let stack frames be
garbage collected). Leo fixed things so that you can now make a 'full'
continuation simply by cloning the current continuation in P1 and there
should only be a performance hit for the call chain that leads to the
continuation (and that hit should be a one time cost you pay when
cloning the continuation). Way to go Leo.</p>
<p>Oh yes, and <code>$P0(...)</code> doesn't throw a syntax error in IMCC any more.</p>
<p><a href='http://groups.google.com/groups?selm=m265ckdfme.fsf@obelisk.bofh.org.uk' target='_blank'>groups.google.com</a></p>
<p><a href='http://groups.google.com/groups?selm=m23c7nvjuk.fsf@obelisk.bofh.org.uk' target='_blank'>groups.google.com</a> -- Continuations made simple</p>
<a name='Collision of running jokes'></a><h2>Collision of running jokes</h2>
<p>Once upon a time, I endeavoured always to mention Leon Brocard in these
summaries, which got increasingly difficult (not to mention tortured) as
his posts to the mailing lists became more and more infrequent. However,
on the first of April (aka the oldest running joke in Christendom) he
posted a couple of patches. Sadly, we didn't manage to get a triple
running joke collision, for it was Leo Tötsch and not chromatic who
applied the patches.</p>
<p><a href='http://groups.google.com/groups?selm=20040401114111.GA8636@kanga.astray.com' target='_blank'>groups.google.com</a></p>
<a name='Stream library'></a><h2>Stream library</h2>
<p>Okay, if Leo Tötsch is the Patchmonster, then Jens Rieks shows every
indication of becoming the Libmonster. Not content with implementing
Data::Dumper in pure Parrot, he's working on an EBNF Parser and, on
Friday he released his first working development version of a Stream
library which wraps all sorts of sources of strings behind a simple
interface (suitable for parsers, for instance). Leo had a few issues
with some of the implementation choices that potentially make it a
little tricky to subclass streams (and then the week ended, but a
little bird tells me that Jens took these comments on board and redid
the library).</p>
<p><a href='http://groups.google.com/groups?selm=200404021013.48782.parrot@jensbeimsurfen.de' target='_blank'>groups.google.com</a></p>
<a name='Subroutine calls'></a><h2>Subroutine calls</h2>
<p>Leo announced that he's added a <code>pmc_const</code> opcode to parrot. The idea
being that, in general subroutines don't vary that much so instead of
having to call <code>newsub</code> every time you make a function call (IMCC
usually does this), you would instead fetch a preexisting Subroutine
PMC from the PMC constant pool.</p>
<p><a href='http://groups.google.com/groups?selm=406D85DA.6090003@toetsch.at' target='_blank'>groups.google.com</a></p>
<a name='Named attribute access'></a><h2>Named attribute access</h2>
<p>In a very short (but useful) post, Leo announced that you could now do</p>
<pre>    getattribute $P0, anObject, &quot;attribute&quot;
    setattribute anObject, &quot;attribute&quot;, $P0</pre>
<p>For which I personally thank him profusely.</p>
<p><a href='http://groups.google.com/groups?selm=406EDF7F.5060107@toetsch.at' target='_blank'>groups.google.com</a></p>
<a name='Meanwhile, over in perl6-language'></a><h1>Meanwhile, over in perl6-language</h1>
<p>Things were pretty quiet. But not utterly quiet</p>
<a name='Default Program'></a><h2>Default Program</h2>
<p>Extrapolating from the general Perl principle that, in the absence of
any indication otherwise, Perl should use a sensible default, Brent
Royal-Gordon proposed that Perl 6 should extend this principle to
entire programs. He proposed that, when the whole program was an empty
string, Perl 6 should substitute a sensible default program. Based on
extensive research on the Internet and printed Perl documentation, he
proposed that the default program should be:</p>
<pre>    print &quot;Hello world!\n&quot;</pre>
<p>Apart from those who quibbled with his punctuation, the general
response was positive. However, always one to take a good idea that one
step further, Austin Hastings suggested that a more sensible default
would be to have a naked invocation of perl launch an editor (or other
script development environment). He proposed that, to this end, the
Parrot team should be focusing on implementing elisp in Parrot rather
than worrying about winning the Piethon.</p>
<p>Richard Nuttall thought that Austin hadn't gone far enough, he proposed
that Perl 6 should load the DWIM::AI module and provide as output the
script you were intending to write.</p>
<p>A quick glance at the calendar was in order at about this time.</p>
<p><a href='http://groups.google.com/groups?selm=406BCD38.3080108@brentdax.com' target='_blank'>groups.google.com</a></p>
<a name='Can colons control backtracking in logical expressions?'></a><h2>Can colons control backtracking in logical expressions?</h2>
<p>Gleefully ignoring Larry's stricture that &quot;I [Larry] get the colon.&quot;,
Austin Hastings wondered about using <code>::</code> to mean something special in
conditional statements. Quite what his proposal offered over and above</p>
<pre>    if specific_condition() ?? detail() :: general_condition()
      { ... }</pre>
<p>perplexed Damian somewhat (though he did forget that <code>... ? ... : ...</code>
has become <code>... ?? ... :: ...</code> in Perl 6. Elsewhere in the thread,
Larry reminded everyone that Perl 6 will not be confusing statements
and expressions.</p>
<p><a href='http://groups.google.com/groups?selm=ICELKKFHGNOHCNCCCBKFKEDNCLAA.Austin_Hastings@Yahoo.com' target='_blank'>groups.google.com</a></p>
<a name='Announcements, Acknowledgements, Apologies'></a><h1>Announcements, Acknowledgements, Apologies</h1>
<p>No announcements this week, apart from the one earlier about the next
summary being due in two weeks because of Easter.</p>
<p>If you find these summaries useful or enjoyable, please consider
contributing to the Perl Foundation to help support the development of
Perl. You might also like to send me feedback at
mailto:<a href='mailto:pdcawley@bofh.org.uk'>pdcawley@bofh.org.uk</a> or, if you find yourself at Miskin Folk
Festival this Easter weekend, you could always buy me a drink.</p>
<p><a href='http://donate.perl-foundation.org/' target='_blank'>donate.perl-foundation.org</a> -- The Perl Foundation</p>
<p><a href='http://dev.perl.org/perl6/' target='_blank'>dev.perl.org</a> -- Perl 6 Development site</p>
<p><a href='http://www.miskinfolk.cjb.net/' target='_blank'>www.miskinfolk.cjb.net</a> -- Miskin folk festival</p>
</div>
